package pta.test0607.杨辉三角;

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int num = sc.nextInt();
        YangHui yh = new YangHui();
        yh.YangHui(num);
    }
}
class YangHui{
    public void YangHui(int row){
        int[][] arr = new int[row][row];
        for (int i =0;i<row;i++){
            for (int j=0;j<=i;j++){
                if (j==0||j==i){
                    arr[i][j]=1;
                    System.out.printf("%-4d",1);
                }else {
                    arr[i][j] = arr[i - 1][j] + arr[i - 1][j - 1];
                    System.out.printf("%-4d",arr[i][j]);
                }
            }
            System.out.println();
        }
    }
}
